package cn.tedu.controller;

import cn.tedu.pojo.GradeCat;
import cn.tedu.pojo.Student;
import cn.tedu.service.GradeCatService;
import cn.tedu.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/gradeCat")
public class GradeCatController {
    @Autowired
    private GradeCatService gradeCatService;
    @GetMapping("/findGradeCatList/{level}")
    public SysResult findStudentList(@PathVariable Integer level){
        List<GradeCat> list = gradeCatService.findStudentList(level);
        return SysResult.success(list);
    }
    @PostMapping("/saveGradeCat")
    public SysResult saveGradeCat(@RequestBody GradeCat gradeCat){
        gradeCatService.saveGradeCat(gradeCat);
        return SysResult.success();
    }
}
